//
//  LoginRequestModel.swift
//  FuXingApp
//
//  Created by zqw on 2021/8/4.
//

import UIKit

enum LoginActionType: Int {
    case fecthCode = 100
    case loginNormal
    case loginPhone
    case loginWechat
    case loginApple
    case loginPrivacy
    case loginsetPwd
    case loginForgetPwd
}

// 初始化登录视图
enum loginViewType {
    case msgCode
    case password
    case setPwd
    case resetPwd
    case bindPhone
    case resetTitle //重置标题
}

// 登录信息
struct LoginInfo: Codable {
    
    var token = ""
    var userId = ""
    var wxInfoKey = "wxLoginInfoKey"
    
    let wxInfo = WechatLoginInfo()
    
    enum CodingKeys: String,CodingKey {
        case token = "user_token"
        case userId = "user_id"
    }
    
    struct WechatLoginInfo: Codable {
        var wxOpenid = ""
        var wxAccess_token = ""
        var wxExpires_in = ""
        var wxRefresh_token = ""
        var lastWXAuthDate = ""
        var lastWXAccessTokenUpdate = ""
        var headimgurl = ""
        var nickname = ""
        
        enum CodingKeys: String,CodingKey {
            case nickname = "name"
            case wxOpenid = "open_id"
        }
    }
}

struct LoginRequest {
    var phoneNum   = ""
    var password   = ""
    var resetPwd   = ""
    var msgCodeNum = ""
}

class LoginRequestModel: NSObject {
    var req :LoginRequest = LoginRequest()

}
